﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HeroDream
{
    public delegate void Forging();

    /// <summary>
    /// 铁匠铺
    /// </summary>
    class Smithy
    {
        //锻造委托
        Forging forging;

        /// <summary>
        /// 锻造委托
        /// </summary>
        /// <param name="forging"></param>
        public void SetForging(Forging forging)
        {
            if (this.forging == null)
            {
                this.forging = forging;
            }
            else
            {
                this.forging += forging;
            }
           
            Console.WriteLine("英雄向铁匠铺发送了一个锻造委托");
        }

        /// <summary>
        /// 锻造
        /// </summary>
        /// <param name="equipment"></param>
        public void StartForging()
        {
            Console.WriteLine("铁匠铺开始工作");
            if (forging == null)
            {
                Console.WriteLine("铁匠铺今日无活");
            }
            else
            {
                forging.Invoke();
                Console.WriteLine("铁匠铺锻造完成");
                forging = null;
            }

        }

    }
}
